const router = require("koa-router")();
const ArticleModel = require("../../models/article");
router.get("/api/articleDetail",async ctx=>{
    var {id} = ctx.query;
    console.log(666);
    var result = [];
    let res = await ArticleModel.find({_id:id});
    result.push(...res);
    if(result.length==0){
        ctx.body = {
            code:200,
            msg:`未搜索到关键字！`
        }
    }else{
        ctx.body = {
            code:200,
            result,
            msg:`搜索成功！搜索到${result.length}条数据。`
        }
    }
    
})
module.exports = router;